AC_INIT([casperd], [1.1], [ivano.culmine@gmail.com], [casperd], [http://casperd.googlecode.com/])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_RANLIB
AC_PROG_CXX

AC_PREFIX_DEFAULT(/usr/local/casperd)

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile src/modules/Makefile scripts/Makefile scripts/modules/Makefile etc/Makefile plugins/Makefile plugins/render/Makefile])

AC_TYPE_PID_T

AC_FUNC_FORK
AC_FUNC_MALLOC

ACX_PTHREAD([])

AC_CHECK_FUNCS([dup2])
AC_CHECK_FUNCS([inet_ntoa])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([select])
AC_CHECK_FUNCS([setenv])
AC_CHECK_FUNCS([socket])
AC_CHECK_FUNCS([strchr])
AC_CHECK_FUNCS([strerror])

AC_CHECK_HEADERS([arpa/inet.h])
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([sys/ioctl.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([syslog.h])
AC_CHECK_HEADERS([dlfcn.h])
AC_CHECK_HEADERS([openssl/ssl.h])

CPPFLAGS="-DPREFIX=\"\\\"\${prefix}\\\"\" -DSYSCONF=\"\\\"\${sysconfdir}\\\"\" $CPPFLAGS"

AC_OUTPUT
